﻿using System;

namespace _1450_number_of_students_doing_homework_at_a_given_time
{
    class Program
    {
        static void Main (string[] args)
        {
            int[] startTime = new int[] { 1, 2, 3 };
            int[] endTime = new int[] { 3, 2, 7 };
            Console.WriteLine (BusyStudent (startTime, endTime, 4));
        }

        public static int BusyStudent (int[] startTime, int[] endTime, int queryTime)
        {
            int count = 0;

            for (int i = 0;i < startTime.Length;i++)
            {
                if (queryTime >= startTime[i] && queryTime <= endTime[i]) count++;
            }

            return count;
        }
    }
}
